FROM openjdk:11

ENV project="lionel-gateway"

ENV spring.application.name=$project

ENV JAVA_OPTS="-Xms128m -Xmx256m -server --add-exports java.desktop/sun.font=ALL-UNNAMED  -Djava.security.egd=file:/dev/./urandom"

ENV TZ=Asia/Shanghai

RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

EXPOSE 9999

RUN mkdir /opt/app

ADD ./target/$project.jar /opt/app

ENTRYPOINT java -jar /opt/app/$project.jar $JAVA_OPTS
